<template>
  <div class="query_content">
    <!-- 缺陷查询报表 -->
    <!-- 搜索框 -->
    <div class="query_serch">
      <el-form class="table_serch">
        <div class="table_serch_labe" id="revpen">
          <div class="table_serch_labe_title">机种</div>
          <Ariplandown
            style="margin-left: 5px"
            :modlulist="modlulist"
            :formInline="formInline"
          ></Ariplandown>
        </div>

        <div class="table_serch_labe" style="margin-left: 15px">
          <div class="table_serch_labe_title">线体</div>
          <Linedrpdown
            :linedroplist="linedroplist"
            :formInline="formInline"
          ></Linedrpdown>
        </div>

        <div class="table_serch_labe" style="margin-left: 15px">
          <div class="table_serch_labe_title">站点</div>
          <el-form-item label="">
            <el-select
              v-model="formInline.step"
              clearable
              size="mini"
              style="margin-left: 5px; margin-top: 0px; width: 140px"
              placeholder="请选择内容"
            >
              <el-option label="MA480" value="MA480"></el-option>
              <el-option label="MA490" value="MA490"></el-option>
            </el-select>
          </el-form-item>
        </div>

        <div class="table_serch_labe" style="margin-left: 15px">
          <div class="table_serch_labe_title">缺陷</div>
          <el-form-item label="">
                <Defectoptions
                  :Defectlist="Defectlist"
                  :formInline="formInline"
                  ></Defectoptions>
          </el-form-item>
        </div>

        <div class="table_serch_labe" style="margin-left: 0px">
          <div class="table_serch_labe_title">起始日期</div>
          <el-form-item label="">
            <StartTime  :formInline="formInline"></StartTime>
          </el-form-item>
        </div>

        <div class="table_serch_labe" style="margin-left: 0px">
          <div class="table_serch_labe_title">结束日期</div>
          <el-form-item label="">
             <Endtime :formInline="formInline"></Endtime>
          </el-form-item>
        </div>

        <div class="table_serch_labe and_table" style="margin-left: 0%">
          <div class="table_serch_labe_title">人员</div>
          <el-autocomplete
            size="mini"
            popper-class="my-autocomplete"
            style="
              width: 140px;
              height: 30px;
              margin-left: 12px;
              margin-top: 5px;
            "
            v-model="formInline.personid"
            :fetch-suggestions="querySearch"
            @input="(e) => (formInline.personid = validForbid(e))"
            placeholder="请输入内容"
            @select="handleSelect"
          >
            <i
              class="el-icon-edit el-input__icon"
              slot="suffix"
              @click="handleIconClick"
            >
            </i>
            <template slot-scope="{ item }">
              <div class="name">{{ item.value }}</div>
              <span class="addr">{{ item.address }}</span>
            </template>
          </el-autocomplete>
        </div>

        <div class="table_serch_labe" style="margin-right: 61.5%">
          <div class="table_serch_labe_title order">班次</div>
          <el-select
            v-model="formInline.class"
            clearable
            size="mini"
            style="margin-left: 5px; margin-top: 8px; width: 140px"
            placeholder="请选择内容"
          >
            <el-option label="白班" value="白班"></el-option>
            <el-option label="夜班" value="夜班"></el-option>
          </el-select>
        </div>

        <div class="table_serch_labe" style="margin-left: 0%">
          <el-button
            type="primary"
            size="mini"
            style="height: 30px; margin-top: 5px"
            @click="defectinquire"
            >查询</el-button
          >
        </div>
      </el-form>
    </div>
    <div class="query_hader"></div>
    <!-- 重叠柱状图 -->
    <!-- <div id="quety_bra"></div> -->

    <!-- 不良率柱状图-->
    <div id="query_barst"></div>

    <!-- 人员系列 -->
    <div id="query_barey"></div>

    <div class="query_table_to">
      <div style="padding: 10px; font-size: 12px">人员检出统计表</div>
      <div style="width: 100%">
        <el-table
          :data="tablelistitems.slice(1)"
          border
          highlight-current-row
          size="mini"
          :cell-style="rowClass"
          :cell-class-name="rowaClass"
          :header-cell-style="headClass"
          :row-style="{ height: '10px' }"
          @row-click="hanclick"
          style="font-size: 10px"
        >
          <el-table-column
            min-width="9"
            v-for="(item, index) in this.btableitms[0]"
            :key="index"
            :label="item"
            :prop="item"
          >
          </el-table-column>
        </el-table>
        <!-- <table
          class="table_query"
          border="1"
          style="font-size: 10px; width: 100%;"
        >
          <tr v-for="(item, index) in this.btableitms" :key="index"  @click="handietableClick(item)">
            <td v-for="(itm, inx) in item" :key="inx">
              {{ itm }}
            </td>
          </tr>
        </table> -->
      </div>
    </div>

    <Popup
      v-show="Popup_show"
      @ClosePopup="ClosePopup"
      @cancelget="cancelget"
      :timer="timer"
    ></Popup>
  </div>
</template>

<script>
// import Siteandown from "../../../components/siteandown/Siteandown";
import Ariplandown from "../../../components/Airplandown/Airplandown";
import Linedrpdown from "../../../components/Linedropdown/Linedropdown";
import Defectoptions from '../../../components/Defectoptions/Defectoptions'
import axios from "axios";
import Popup from "../../Pop-up/Pop-up";
import Endtime from '../../../components/endTime/Endtime'
import StartTime from '../../../components/StarTime/StartTime'
export default {
  components: { Popup, Ariplandown, Linedrpdown,Defectoptions,
   Endtime,StartTime
  },
  data() {
    return {
      timer: 0,
      Popup_show: false,
      isshow: false,
      valtimer: "",
      tableData: [],
      assemblelist: [],
      tablelist: [],
      items: [],
      formInline: {
        recipe: "",
        order: "",
        line: "",
        step: "",
        starttime: "",
        endtime: "",
        errorcode: "",
        class: "",
        personid: "",
        type: [],
      },
      options: [],
      restaurants: [],
      datalist: [],
      barlist2: [],
      barlist3: [],
      total: "",
      linelist: [],
      listbar: [],
      listdata: [],
      xAis: [], 
      timeitem: [
        "人员",
        "00:00",
        "01:00",
        "02:00",
        "03:00",
        "04:00",
        "05:00",
        "06:00",
        "07:00",
        "08:00",
        "09:00",
        "10:00",
        "11:00",
        "12:00",
        "13:00",
        "14:00",
        "15:00",
        "16:00",
        "17:00",
        "18:00",
        "19:00",
        "20:00",
        "21:00",
        "22:00",
        "23:00",
      ],
      btableitms: [],
      tablelistitems: [],
      modlulist: [],
      linedroplist: [],
      sitedrwn: [],
       Defectlist:[]
    };
  },

  methods: {
    ClosePopup() {
      this.Popup_show = false;
      clearInterval(this.Popup_timer);
    },
    getModelnolist() {
      this.ajax(`func/1023/selProductList`).then((res) => {
        if (res.status == 200) {
          this.modlulist = res.data.product;
          this.sitedrwn = res.data.step;
          this.linedroplist = res.data.line;
        }
      });
       this.ajax(`func/1023/selDef`).then((res)=>{
           if(res.status == 200){
                for(var k = 0; k < res.data.length; k++){
                    if(this.Defectlist.indexOf(res.data[k].DFT_TYPE) == -1){
                        this.Defectlist.push(res.data[k].DFT_TYPE)
                    }
                }
           }
        })
    },

    // 表头样式设置
    headClass() {
      return "text-align: center;background:#696969;color:#fff";
    },

    // 表格样式设置
    rowClass() {
      return "text-align: center;";
    },

    ////表格单元点击事件
    hanclick(row) {
      this.formInline.personid = row.item;
      this.ajax
        .get(
          `prod/1027?starttime=${this.formInline.starttime}&endtime=${this.formInline.endtime}&recipe=${this.formInline.recipe}&line=${this.formInline.line}&step=${this.formInline.step}&class=${this.formInline.class}&order=${this.formInline.order}&personid=${this.formInline.personid}&errorcode=${this.formInline.errorcode}`
        )
        .then((res) => {
          if (res.status == 200) {
            console.log(res.data)
            var temp = [];
            var cache_key = "";
            var num = "";
            cache_key = res.data.tableInfo.cache_key;
            temp = res.data.tableInfo.heads[0];
            num = res.data.tableInfo.row_num;
            var router = this.$router.resolve({
              path: "/itemDow",
              query: {
                data: temp,
                key: cache_key,
                num: num,
              },
            });
            window.open(router.href);
          }
        });
    },

    // 表格样式设置{ row, column, rowIndex, columnIndex }
    rowaClass({ column, columnIndex }) {
      if (columnIndex === 0) {
        return (column.minWidth = 100);
      } else {
        return (column.minWidth = 50);
      }
      // return 'text-align: center;'
    },
    ///请求数据方法
    defectinquire() {
  if (this.formInline.starttime == "") {
        this.$message({
          showClose: true,
          message: "起始日期不能为空",
          type: "warning",
        });
      } else if (this.formInline.endtime == "") {
        this.$message({
          showClose: true,
          message: "结束日期不能为空",
          type: "warning",
        });
      } else if (this.formInline.endtime < this.formInline.starttime) {
        this.$message({
          showClose: true,
          message: "结束日期不能小于起始日期",
          type: "warning",
        });
      }else {
        const CancelToken = axios.CancelToken;
        this.ajax
          .get(
            `prod/1006?starttime=${this.formInline.starttime}&endtime=${this.formInline.endtime}&recipe=${this.formInline.recipe}&line=${this.formInline.line}&step=${this.formInline.step}&class=${this.formInline.class}&order=${this.formInline.order}&personid=${this.formInline.personid}&errorcode=${this.formInline.errorcode}`,
            {
              cancelToken: new CancelToken((c) => {
                this.cancel = c;
              }),
            }
          )
          .then((res) => {
            var reslut = res.data;
            console.log(reslut);
            if (reslut) {
              var queysdata = reslut;
              this.listbar = queysdata.perDefBar;
              this.datalist = queysdata.lineChart;
              this.barlist2 = queysdata.bar2;
              this.btableitms = queysdata.perDefTable;
              this.xAis = queysdata.xAis;
              if (this.btableitms) {
                this.Tabudataparsingss();
              }
              if (this.barlist2.length) {
                var chat2;
                chat2 = this.$echarts.init(
                  document.getElementById("query_barey")
                );
                chat2.dispose();

                // this.quety_bra();
                this.query_barst();
                this.query_barey();
              } else {
                this.$message({
                  showClose: true,
                  message: "数据返回为空，请重新重新请求",
                  type: "error",
                });
                setTimeout(() => {
                  this.$router.go(0);
                }, 300);
              }
            }
          });
      }
    },

  
    Tabudataparsingss() {
      this.tablelistitems = [];
      // console.log("------------------------", this.btableitms);
      var titlelist = this.btableitms[0];
      var a = titlelist[0];
      var b = titlelist[1];
      var c = titlelist[2];
      var d = titlelist[3];
      var e = titlelist[4];
      var f = titlelist[5];
      var g = titlelist[6];
      var h = titlelist[7];
      var io = titlelist[8];
      var j = titlelist[9];
      var k = titlelist[10];
      var L = titlelist[11];
      var m = titlelist[12];
      var n = titlelist[13];
      var o = titlelist[14];
      var p = titlelist[15];
      var q = titlelist[16];
      var r = titlelist[17];
      var s = titlelist[18];
      var t = titlelist[19];
      var u = titlelist[20];
      var v = titlelist[21];
      var w = titlelist[22];
      var x = titlelist[23];
      var y = titlelist[24];
      var z = titlelist[25];
      var mo = titlelist[26];
      var qa = titlelist[27];
      var qb = titlelist[28];
      var qc = titlelist[29];
      var qd = titlelist[30];
      var qe = titlelist[31];
      var qf = titlelist[32];
      var qh = titlelist[33];
      var qy = titlelist[34];
      if (this.btableitms[0].length == 2) {
        for (let i = 1; i < this.btableitms.length; i++) {
          var objon = {};
          objon[a] = this.btableitms[i][0];
          objon[b] = this.btableitms[i][1];
          this.tablelistitems.push(objon);
        }
      } else if (this.btableitms[0].length == 3) {
        for (let i = 1; i < this.btableitms.length; i++) {
          var obj0 = {};
          obj0[a] = this.btableitms[i][0];
          obj0[b] = this.btableitms[i][1];
          obj0[c] = this.btableitms[i][2];
          // obj[d] = this.bartable[i][3];
          this.tablelistitems.push(obj0);
        }
      } else if (this.btableitms[0].length == 4) {
        for (let i = 1; i < this.btableitms.length; i++) {
          var obj = {};
          obj[a] = this.btableitms[i][0];
          obj[b] = this.btableitms[i][1];
          obj[c] = this.btableitms[i][2];
          obj[d] = this.btableitms[i][3];
          this.tablelistitems.push(obj);
        }
      } else if (this.btableitms[0].length == 5) {
        for (let i = 1; i < this.btableitms.length; i++) {
          var obj1 = {};
          obj1[a] = this.btableitms[i][0];
          obj1[b] = this.btableitms[i][1];
          obj1[c] = this.btableitms[i][2];
          obj1[d] = this.btableitms[i][3];
          obj1[e] = this.btableitms[i][4];
          this.tablelistitems.push(obj1);
        }
      } else if (this.btableitms[0].length == 6) {
        for (let i = 1; i < this.btableitms.length; i++) {
          var obj2 = {};
          obj2[a] = this.btableitms[i][0];
          obj2[b] = this.btableitms[i][1];
          obj2[c] = this.btableitms[i][2];
          obj2[d] = this.btableitms[i][3];
          obj2[e] = this.btableitms[i][4];
          obj2[f] = this.btableitms[i][5];
          this.tablelistitems.push(obj2);
        }
      } else if (this.btableitms[0].length == 7) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj3 = {};
          obj3[a] = this.btableitms[i][0];
          obj3[b] = this.btableitms[i][1];
          obj3[c] = this.btableitms[i][2];
          obj3[d] = this.btableitms[i][3];
          obj3[e] = this.btableitms[i][4];
          obj3[f] = this.btableitms[i][5];
          obj3[g] = this.btableitms[i][6];
          this.tablelistitems.push(obj3);
        }
      } else if (this.btableitms[0].length == 8) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj4 = {};
          obj4[a] = this.btableitms[i][0];
          obj4[b] = this.btableitms[i][1];
          obj4[c] = this.btableitms[i][2];
          obj4[d] = this.btableitms[i][3];
          obj4[e] = this.btableitms[i][4];
          obj4[f] = this.btableitms[i][5];
          obj4[g] = this.btableitms[i][6];
          obj4[h] = this.btableitms[i][7];
          this.tablelistitems.push(obj4);
          // console.log('pppppppppppppppppppppp',this.tablelistitems)
        }
      } else if (this.btableitms[0].length == 9) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj5 = {};
          obj5[a] = this.btableitms[i][0];
          obj5[b] = this.btableitms[i][1];
          obj5[c] = this.btableitms[i][2];
          obj5[d] = this.btableitms[i][3];
          obj5[e] = this.btableitms[i][4];
          obj5[f] = this.btableitms[i][5];
          obj5[g] = this.btableitms[i][6];
          obj5[h] = this.btableitms[i][7];
          obj5[io] = this.btableitms[i][8];
          this.tablelistitems.push(obj5);
        }
      } else if (this.btableitms[0].length == 10) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj6 = {};
          obj6[a] = this.btableitms[i][0];
          obj6[b] = this.btableitms[i][1];
          obj6[c] = this.btableitms[i][2];
          obj6[d] = this.btableitms[i][3];
          obj6[e] = this.btableitms[i][4];
          obj6[f] = this.btableitms[i][5];
          obj6[g] = this.btableitms[i][6];
          obj6[h] = this.btableitms[i][7];
          obj6[io] = this.btableitms[i][8];
          obj6[j] = this.btableitms[i][9];
          this.tablelistitems.push(obj6);
        }
      } else if (this.btableitms[0].length == 11) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj7 = {};
          obj7[a] = this.btableitms[i][0];
          obj7[b] = this.btableitms[i][1];
          obj7[c] = this.btableitms[i][2];
          obj7[d] = this.btableitms[i][3];
          obj7[e] = this.btableitms[i][4];
          obj7[f] = this.btableitms[i][5];
          obj7[g] = this.btableitms[i][6];
          obj7[h] = this.btableitms[i][7];
          obj7[io] = this.btableitms[i][8];
          obj7[j] = this.btableitms[i][9];
          obj7[k] = this.btableitms[i][10];
          this.tablelistitems.push(obj7);
        }
      } else if (this.btableitms[0].length == 12) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj8 = {};
          obj8[a] = this.btableitms[i][0];
          obj8[b] = this.btableitms[i][1];
          obj8[c] = this.btableitms[i][2];
          obj8[d] = this.btableitms[i][3];
          obj8[e] = this.btableitms[i][4];
          obj8[f] = this.btableitms[i][5];
          obj8[g] = this.btableitms[i][6];
          obj8[h] = this.btableitms[i][7];
          obj8[io] = this.btableitms[i][8];
          obj8[j] = this.btableitms[i][9];
          obj8[k] = this.btableitms[i][10];
          obj8[L] = this.btableitms[i][11];
          this.tablelistitems.push(obj8);
        }
      } else if (this.btableitms[0].length == 13) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj9 = {};
          obj9[a] = this.btableitms[i][0];
          obj9[b] = this.btableitms[i][1];
          obj9[c] = this.btableitms[i][2];
          obj9[d] = this.btableitms[i][3];
          obj9[e] = this.btableitms[i][4];
          obj9[f] = this.btableitms[i][5];
          obj9[g] = this.btableitms[i][6];
          obj9[h] = this.btableitms[i][7];
          obj9[io] = this.btableitms[i][8];
          obj9[j] = this.btableitms[i][9];
          obj9[k] = this.btableitms[i][10];
          obj9[L] = this.btableitms[i][11];
          obj9[m] = this.btableitms[i][12];
          this.tablelistitems.push(obj9);
        }
      } else if (this.btableitms[0].length == 14) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj10 = {};
          obj10[a] = this.btableitms[i][0];
          obj10[b] = this.btableitms[i][1];
          obj10[c] = this.btableitms[i][2];
          obj10[d] = this.btableitms[i][3];
          obj10[e] = this.btableitms[i][4];
          obj10[f] = this.btableitms[i][5];
          obj10[g] = this.btableitms[i][6];
          obj10[h] = this.btableitms[i][7];
          obj10[io] = this.btableitms[i][8];
          obj10[j] = this.btableitms[i][9];
          obj10[k] = this.btableitms[i][10];
          obj10[L] = this.btableitms[i][11];
          obj10[m] = this.btableitms[i][12];
          obj10[n] = this.btableitms[i][13];
          this.tablelistitems.push(obj10);
        }
      } else if (this.btableitms[0].length == 15) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj11 = {};
          obj11[a] = this.btableitms[i][0];
          obj11[b] = this.btableitms[i][1];
          obj11[c] = this.btableitms[i][2];
          obj11[d] = this.btableitms[i][3];
          obj11[e] = this.btableitms[i][4];
          obj11[f] = this.btableitms[i][5];
          obj11[g] = this.btableitms[i][6];
          obj11[h] = this.btableitms[i][7];
          obj11[io] = this.btableitms[i][8];
          obj11[j] = this.btableitms[i][9];
          obj11[k] = this.btableitms[i][10];
          obj11[L] = this.btableitms[i][11];
          obj11[m] = this.btableitms[i][12];
          obj11[n] = this.btableitms[i][13];
          obj11[o] = this.btableitms[i][14];
          this.tablelistitems.push(obj11);
        }
      } else if (this.btableitms[0].length == 16) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj12 = {};
          obj12[a] = this.btableitms[i][0];
          obj12[b] = this.btableitms[i][1];
          obj12[c] = this.btableitms[i][2];
          obj12[d] = this.btableitms[i][3];
          obj12[e] = this.btableitms[i][4];
          obj12[f] = this.btableitms[i][5];
          obj12[g] = this.btableitms[i][6];
          obj12[h] = this.btableitms[i][7];
          obj12[io] = this.btableitms[i][8];
          obj12[j] = this.btableitms[i][9];
          obj12[k] = this.btableitms[i][10];
          obj12[L] = this.btableitms[i][11];
          obj12[m] = this.btableitms[i][12];
          obj12[n] = this.btableitms[i][13];
          obj12[o] = this.btableitms[i][14];
          obj12[p] = this.btableitms[i][15];
          this.tablelistitems.push(obj12);
        }
      } else if (this.btableitms[0].length == 17) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj13 = {};
          obj13[a] = this.btableitms[i][0];
          obj13[b] = this.btableitms[i][1];
          obj13[c] = this.btableitms[i][2];
          obj13[d] = this.btableitms[i][3];
          obj13[e] = this.btableitms[i][4];
          obj13[f] = this.btableitms[i][5];
          obj13[g] = this.btableitms[i][6];
          obj13[h] = this.btableitms[i][7];
          obj13[io] = this.btableitms[i][8];
          obj13[j] = this.btableitms[i][9];
          obj13[k] = this.btableitms[i][10];
          obj13[L] = this.btableitms[i][11];
          obj13[m] = this.btableitms[i][12];
          obj13[n] = this.btableitms[i][13];
          obj13[o] = this.btableitms[i][14];
          obj13[p] = this.btableitms[i][15];
          obj13[q] = this.btableitms[i][16];
          this.tablelistitems.push(obj13);
        }
      } else if (this.btableitms[0].length == 18) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj14 = {};
          obj14[a] = this.btableitms[i][0];
          obj14[b] = this.btableitms[i][1];
          obj14[c] = this.btableitms[i][2];
          obj14[d] = this.btableitms[i][3];
          obj14[e] = this.btableitms[i][4];
          obj14[f] = this.btableitms[i][5];
          obj14[g] = this.btableitms[i][6];
          obj14[h] = this.btableitms[i][7];
          obj14[io] = this.btableitms[i][8];
          obj14[j] = this.btableitms[i][9];
          obj14[k] = this.btableitms[i][10];
          obj14[L] = this.btableitms[i][11];
          obj14[m] = this.btableitms[i][12];
          obj14[n] = this.btableitms[i][13];
          obj14[o] = this.btableitms[i][14];
          obj14[p] = this.btableitms[i][15];
          obj14[q] = this.btableitms[i][16];
          obj14[r] = this.btableitms[i][17];
          this.tablelistitems.push(obj14);
        }
      } else if (this.btableitms[0].length == 19) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj15 = {};
          obj15[a] = this.btableitms[i][0];
          obj15[b] = this.btableitms[i][1];
          obj15[c] = this.btableitms[i][2];
          obj15[d] = this.btableitms[i][3];
          obj15[e] = this.btableitms[i][4];
          obj15[f] = this.btableitms[i][5];
          obj15[g] = this.btableitms[i][6];
          obj15[h] = this.btableitms[i][7];
          obj15[io] = this.btableitms[i][8];
          obj15[j] = this.btableitms[i][9];
          obj15[k] = this.btableitms[i][10];
          obj15[L] = this.btableitms[i][11];
          obj15[m] = this.btableitms[i][12];
          obj15[n] = this.btableitms[i][13];
          obj15[o] = this.btableitms[i][14];
          obj15[p] = this.btableitms[i][15];
          obj15[q] = this.btableitms[i][16];
          obj15[r] = this.btableitms[i][17];
          obj15[s] = this.btableitms[i][18];
          this.tablelistitems.push(obj15);
        }
      } else if (this.btableitms[0].length == 20) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj16 = {};
          obj16[a] = this.btableitms[i][0];
          obj16[b] = this.btableitms[i][1];
          obj16[c] = this.btableitms[i][2];
          obj16[d] = this.btableitms[i][3];
          obj16[e] = this.btableitms[i][4];
          obj16[f] = this.btableitms[i][5];
          obj16[g] = this.btableitms[i][6];
          obj16[h] = this.btableitms[i][7];
          obj16[io] = this.btableitms[i][8];
          obj16[j] = this.btableitms[i][9];
          obj16[k] = this.btableitms[i][10];
          obj16[L] = this.btableitms[i][11];
          obj16[m] = this.btableitms[i][12];
          obj16[n] = this.btableitms[i][13];
          obj16[o] = this.btableitms[i][14];
          obj16[p] = this.btableitms[i][15];
          obj16[q] = this.btableitms[i][16];
          obj16[r] = this.btableitms[i][17];
          obj16[s] = this.btableitms[i][18];
          obj16[t] = this.btableitms[i][19];
          this.tablelistitems.push(obj16);
        }
      } else if (this.btableitms[0].length == 21) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj17 = {};
          obj17[a] = this.btableitms[i][0];
          obj17[b] = this.btableitms[i][1];
          obj17[c] = this.btableitms[i][2];
          obj17[d] = this.btableitms[i][3];
          obj17[e] = this.btableitms[i][4];
          obj17[f] = this.btableitms[i][5];
          obj17[g] = this.btableitms[i][6];
          obj17[h] = this.btableitms[i][7];
          obj17[io] = this.btableitms[i][8];
          obj17[j] = this.btableitms[i][9];
          obj17[k] = this.btableitms[i][10];
          obj17[L] = this.btableitms[i][11];
          obj17[m] = this.btableitms[i][12];
          obj17[n] = this.btableitms[i][13];
          obj17[o] = this.btableitms[i][14];
          obj17[p] = this.btableitms[i][15];
          obj17[q] = this.btableitms[i][16];
          obj17[r] = this.btableitms[i][17];
          obj17[s] = this.btableitms[i][18];
          obj17[t] = this.btableitms[i][19];
          obj17[u] = this.btableitms[i][20];
          this.tablelistitems.push(obj17);
        }
      } else if (this.btableitms[0].length == 22) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj18 = {};
          obj18[a] = this.btableitms[i][0];
          obj18[b] = this.btableitms[i][1];
          obj18[c] = this.btableitms[i][2];
          obj18[d] = this.btableitms[i][3];
          obj18[e] = this.btableitms[i][4];
          obj18[f] = this.btableitms[i][5];
          obj18[g] = this.btableitms[i][6];
          obj18[h] = this.btableitms[i][7];
          obj18[io] = this.btableitms[i][8];
          obj18[j] = this.btableitms[i][9];
          obj18[k] = this.btableitms[i][10];
          obj18[L] = this.btableitms[i][11];
          obj18[m] = this.btableitms[i][12];
          obj18[n] = this.btableitms[i][13];
          obj18[o] = this.btableitms[i][14];
          obj18[p] = this.btableitms[i][15];
          obj18[q] = this.btableitms[i][16];
          obj18[r] = this.btableitms[i][17];
          obj18[s] = this.btableitms[i][18];
          obj18[t] = this.btableitms[i][19];
          obj18[u] = this.btableitms[i][20];
          obj18[v] = this.btableitms[i][21];
          this.tablelistitems.push(obj18);
        }
      } else if (this.btableitms[0].length == 23) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj19 = {};
          obj19[a] = this.btableitms[i][0];
          obj19[b] = this.btableitms[i][1];
          obj19[c] = this.btableitms[i][2];
          obj19[d] = this.btableitms[i][3];
          obj19[e] = this.btableitms[i][4];
          obj19[f] = this.btableitms[i][5];
          obj19[g] = this.btableitms[i][6];
          obj19[h] = this.btableitms[i][7];
          obj19[io] = this.btableitms[i][8];
          obj19[j] = this.btableitms[i][9];
          obj19[k] = this.btableitms[i][10];
          obj19[L] = this.btableitms[i][11];
          obj19[m] = this.btableitms[i][12];
          obj19[n] = this.btableitms[i][13];
          obj19[o] = this.btableitms[i][14];
          obj19[p] = this.btableitms[i][15];
          obj19[q] = this.btableitms[i][16];
          obj19[r] = this.btableitms[i][17];
          obj19[s] = this.btableitms[i][18];
          obj19[t] = this.btableitms[i][19];
          obj19[u] = this.btableitms[i][20];
          obj19[v] = this.btableitms[i][21];
          obj19[w] = this.btableitms[i][22];
          this.tablelistitems.push(obj19);
        }
      } else if (this.btableitms[0].length == 24) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj20 = {};
          obj20[a] = this.btableitms[i][0];
          obj20[b] = this.btableitms[i][1];
          obj20[c] = this.btableitms[i][2];
          obj20[d] = this.btableitms[i][3];
          obj20[e] = this.btableitms[i][4];
          obj20[f] = this.btableitms[i][5];
          obj20[g] = this.btableitms[i][6];
          obj20[h] = this.btableitms[i][7];
          obj20[io] = this.btableitms[i][8];
          obj20[j] = this.btableitms[i][9];
          obj20[k] = this.btableitms[i][10];
          obj20[L] = this.btableitms[i][11];
          obj20[m] = this.btableitms[i][12];
          obj20[n] = this.btableitms[i][13];
          obj20[o] = this.btableitms[i][14];
          obj20[p] = this.btableitms[i][15];
          obj20[q] = this.btableitms[i][16];
          obj20[r] = this.btableitms[i][17];
          obj20[s] = this.btableitms[i][18];
          obj20[t] = this.btableitms[i][19];
          obj20[u] = this.btableitms[i][20];
          obj20[v] = this.btableitms[i][21];
          obj20[w] = this.btableitms[i][22];
          obj20[x] = this.btableitms[i][23];
          this.tablelistitems.push(obj20);
        }
      } else if (this.btableitms[0].length == 25) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj21 = {};
          obj21[a] = this.btableitms[i][0];
          obj21[b] = this.btableitms[i][1];
          obj21[c] = this.btableitms[i][2];
          obj21[d] = this.btableitms[i][3];
          obj21[e] = this.btableitms[i][4];
          obj21[f] = this.btableitms[i][5];
          obj21[g] = this.btableitms[i][6];
          obj21[h] = this.btableitms[i][7];
          obj21[io] = this.btableitms[i][8];
          obj21[j] = this.btableitms[i][9];
          obj21[k] = this.btableitms[i][10];
          obj21[L] = this.btableitms[i][11];
          obj21[m] = this.btableitms[i][12];
          obj21[n] = this.btableitms[i][13];
          obj21[o] = this.btableitms[i][14];
          obj21[p] = this.btableitms[i][15];
          obj21[q] = this.btableitms[i][16];
          obj21[r] = this.btableitms[i][17];
          obj21[s] = this.btableitms[i][18];
          obj21[t] = this.btableitms[i][19];
          obj21[u] = this.btableitms[i][20];
          obj21[v] = this.btableitms[i][21];
          obj21[w] = this.btableitms[i][22];
          obj21[x] = this.btableitms[i][23];
          obj21[y] = this.btableitms[i][24];
          this.tablelistitems.push(obj21);
          // console.log(this.tablelistitems)
        }
      } else if (this.btableitms[0].length == 26) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj22 = {};
          obj22[a] = this.btableitms[i][0];
          obj22[b] = this.btableitms[i][1];
          obj22[c] = this.btableitms[i][2];
          obj22[d] = this.btableitms[i][3];
          obj22[e] = this.btableitms[i][4];
          obj22[f] = this.btableitms[i][5];
          obj22[g] = this.btableitms[i][6];
          obj22[h] = this.btableitms[i][7];
          obj22[io] = this.btableitms[i][8];
          obj22[j] = this.btableitms[i][9];
          obj22[k] = this.btableitms[i][10];
          obj22[L] = this.btableitms[i][11];
          obj22[m] = this.btableitms[i][12];
          obj22[n] = this.btableitms[i][13];
          obj22[o] = this.btableitms[i][14];
          obj22[p] = this.btableitms[i][15];
          obj22[q] = this.btableitms[i][16];
          obj22[r] = this.btableitms[i][17];
          obj22[s] = this.btableitms[i][18];
          obj22[t] = this.btableitms[i][19];
          obj22[u] = this.btableitms[i][20];
          obj22[v] = this.btableitms[i][21];
          obj22[w] = this.btableitms[i][22];
          obj22[x] = this.btableitms[i][23];
          obj22[y] = this.btableitms[i][24];
          obj22[z] = this.btableitms[i][25];
          this.tablelistitems.push(obj22);
          console.log("2222222222222222222", this.tablelistitems);
        }
      } else if (this.btableitms[0].length == 27) {
        for (let i = 0; i < this.btableitms.length; i++) {
          var obj23 = {};
          obj23[a] = this.btableitms[i][0];
          obj23[b] = this.btableitms[i][1];
          obj23[c] = this.btableitms[i][2];
          obj23[d] = this.btableitms[i][3];
          obj23[e] = this.btableitms[i][4];
          obj23[f] = this.btableitms[i][5];
          obj23[g] = this.btableitms[i][6];
          obj23[h] = this.btableitms[i][7];
          obj23[io] = this.btableitms[i][8];
          obj23[j] = this.btableitms[i][9];
          obj23[k] = this.btableitms[i][10];
          obj23[L] = this.btableitms[i][11];
          obj23[m] = this.btableitms[i][12];
          obj23[n] = this.btableitms[i][13];
          obj23[o] = this.btableitms[i][14];
          obj23[p] = this.btableitms[i][15];
          obj23[q] = this.btableitms[i][16];
          obj23[r] = this.btableitms[i][17];
          obj23[s] = this.btableitms[i][18];
          obj23[t] = this.btableitms[i][19];
          obj23[u] = this.btableitms[i][20];
          obj23[v] = this.btableitms[i][21];
          obj23[w] = this.btableitms[i][22];
          obj23[x] = this.btableitms[i][23];
          obj23[y] = this.btableitms[i][24];
          obj23[z] = this.btableitms[i][25];
          obj23[mo] = this.btableitms[i][26];
        }
        this.tablelistitems.push(obj23);
      }else if (this.btableitms[0].length == 28){
         for(let i =0 ; i<this.btableitms.length;i++){
           var obj24 = {};
           obj24[a] = this.btableitms[i][0];
           obj24[b] = this.btableitms[i][1];
           obj24[c] = this.btableitms[i][2];
           obj24[d] = this.btableitms[i][3];
           obj24[e] = this.btableitms[i][4];
           obj24[f] = this.btableitms[i][5];
           obj24[g] = this.btableitms[i][6];
           obj24[h] = this.btableitms[i][7];
           obj24[io] = this.btableitms[i][8];
           obj24[j] = this.btableitms[i][9];
           obj24[k] = this.btableitms[i][10];
           obj24[L] = this.btableitms[i][11];
           obj24[m] = this.btableitms[i][12];
           obj24[n] = this.btableitms[i][13];
           obj24[o] = this.btableitms[i][14];
           obj24[p] = this.btableitms[i][15];
           obj24[q] = this.btableitms[i][16];
           obj24[r] = this.btableitms[i][17];
           obj24[s] = this.btableitms[i][18];
           obj24[t] = this.btableitms[i][19];
           obj24[u] = this.btableitms[i][20];
           obj24[v] = this.btableitms[i][21];
           obj24[w] = this.btableitms[i][22];
           obj24[x] = this.btableitms[i][23];
           obj24[y] = this.btableitms[i][24];
           obj24[z] = this.btableitms[i][25];
           obj24[mo] = this.btableitms[i][26];
           obj24[qa] = this.btableitms[i][27];
         }
          this.tablelistitems.push(obj24);
      }else if(this.btableitms[0].length == 29){
          for(let i =0 ; i<this.btableitms.length;i++){
           var obj25 = {};
           obj25[a] = this.btableitms[i][0];
           obj25[b] = this.btableitms[i][1];
           obj25[c] = this.btableitms[i][2];
           obj25[d] = this.btableitms[i][3];
           obj25[e] = this.btableitms[i][4];
           obj25[f] = this.btableitms[i][5];
           obj25[g] = this.btableitms[i][6];
           obj25[h] = this.btableitms[i][7];
           obj25[io] = this.btableitms[i][8];
           obj25[j] = this.btableitms[i][9];
           obj25[k] = this.btableitms[i][10];
           obj25[L] = this.btableitms[i][11];
           obj25[m] = this.btableitms[i][12];
           obj25[n] = this.btableitms[i][13];
           obj25[o] = this.btableitms[i][14];
           obj25[p] = this.btableitms[i][15];
           obj25[q] = this.btableitms[i][16];
           obj25[r] = this.btableitms[i][17];
           obj25[s] = this.btableitms[i][18];
           obj25[t] = this.btableitms[i][19];
           obj25[u] = this.btableitms[i][20];
           obj25[v] = this.btableitms[i][21];
           obj25[w] = this.btableitms[i][22];
           obj25[x] = this.btableitms[i][23];
           obj25[y] = this.btableitms[i][24];
           obj25[z] = this.btableitms[i][25];
           obj25[mo] = this.btableitms[i][26];
           obj25[qa] = this.btableitms[i][27];
           obj25[qb] = this.btableitms[i][28];
         }
         this.tablelistitems.push(obj25);
      }else if(this.btableitms[0].length == 30){
            for(let i =0 ; i<this.btableitms.length;i++){
           var obj26 = {};
           obj26[a] = this.btableitms[i][0];
           obj26[b] = this.btableitms[i][1];
           obj26[c] = this.btableitms[i][2];
           obj26[d] = this.btableitms[i][3];
           obj26[e] = this.btableitms[i][4];
           obj26[f] = this.btableitms[i][5];
           obj26[g] = this.btableitms[i][6];
           obj26[h] = this.btableitms[i][7];
           obj26[io] = this.btableitms[i][8];
           obj26[j] = this.btableitms[i][9];
           obj26[k] = this.btableitms[i][10];
           obj26[L] = this.btableitms[i][11];
           obj26[m] = this.btableitms[i][12];
           obj26[n] = this.btableitms[i][13];
           obj26[o] = this.btableitms[i][14];
           obj26[p] = this.btableitms[i][15];
           obj26[q] = this.btableitms[i][16];
           obj26[r] = this.btableitms[i][17];
           obj26[s] = this.btableitms[i][18];
           obj26[t] = this.btableitms[i][19];
           obj26[u] = this.btableitms[i][20];
           obj26[v] = this.btableitms[i][21];
           obj26[w] = this.btableitms[i][22];
           obj26[x] = this.btableitms[i][23];
           obj26[y] = this.btableitms[i][24];
           obj26[z] = this.btableitms[i][25];
           obj26[mo] = this.btableitms[i][26];
           obj26[qa] = this.btableitms[i][27];
           obj26[qb] = this.btableitms[i][28];
           obj26[qc] = this.btableitms[i][29];
         }
         this.tablelistitems.push(obj26);
      }else if(this.btableitms[0].length == 31){
            for(let i =0 ; i<this.btableitms.length;i++){
           var obj27 = {};
           obj27[a] = this.btableitms[i][0];
           obj27[b] = this.btableitms[i][1];
           obj27[c] = this.btableitms[i][2];
           obj27[d] = this.btableitms[i][3];
           obj27[e] = this.btableitms[i][4];
           obj27[f] = this.btableitms[i][5];
           obj27[g] = this.btableitms[i][6];
           obj27[h] = this.btableitms[i][7];
           obj27[io] = this.btableitms[i][8];
           obj27[j] = this.btableitms[i][9];
           obj27[k] = this.btableitms[i][10];
           obj27[L] = this.btableitms[i][11];
           obj27[m] = this.btableitms[i][12];
           obj27[n] = this.btableitms[i][13];
           obj27[o] = this.btableitms[i][14];
           obj27[p] = this.btableitms[i][15];
           obj27[q] = this.btableitms[i][16];
           obj27[r] = this.btableitms[i][17];
           obj27[s] = this.btableitms[i][18];
           obj27[t] = this.btableitms[i][19];
           obj27[u] = this.btableitms[i][20];
           obj27[v] = this.btableitms[i][21];
           obj27[w] = this.btableitms[i][22];
           obj27[x] = this.btableitms[i][23];
           obj27[y] = this.btableitms[i][24];
           obj27[z] = this.btableitms[i][25];
           obj27[mo] = this.btableitms[i][26];
           obj27[qa] = this.btableitms[i][27];
           obj27[qb] = this.btableitms[i][28];
           obj27[qc] = this.btableitms[i][29];
           obj27[qd] = this.btableitms[i][30];
         }
         this.tablelistitems.push(obj27);
      }else if(this.btableitms[0].length == 32){
            for(let i =0 ; i<this.btableitms.length;i++){
           var obj28 = {};
           obj28[a] = this.btableitms[i][0];
           obj28[b] = this.btableitms[i][1];
           obj28[c] = this.btableitms[i][2];
           obj28[d] = this.btableitms[i][3];
           obj28[e] = this.btableitms[i][4];
           obj28[f] = this.btableitms[i][5];
           obj28[g] = this.btableitms[i][6];
           obj28[h] = this.btableitms[i][7];
           obj28[io] = this.btableitms[i][8];
           obj28[j] = this.btableitms[i][9];
           obj28[k] = this.btableitms[i][10];
           obj28[L] = this.btableitms[i][11];
           obj28[m] = this.btableitms[i][12];
           obj28[n] = this.btableitms[i][13];
           obj28[o] = this.btableitms[i][14];
           obj28[p] = this.btableitms[i][15];
           obj28[q] = this.btableitms[i][16];
           obj28[r] = this.btableitms[i][17];
           obj28[s] = this.btableitms[i][18];
           obj28[t] = this.btableitms[i][19];
           obj28[u] = this.btableitms[i][20];
           obj28[v] = this.btableitms[i][21];
           obj28[w] = this.btableitms[i][22];
           obj28[x] = this.btableitms[i][23];
           obj28[y] = this.btableitms[i][24];
           obj28[z] = this.btableitms[i][25];
           obj28[mo] = this.btableitms[i][26];
           obj28[qa] = this.btableitms[i][27];
           obj28[qb] = this.btableitms[i][28];
           obj28[qc] = this.btableitms[i][29];
           obj28[qd] = this.btableitms[i][30];
           obj28[qe] = this.btableitms[i][31];
         }
         this.tablelistitems.push(obj28);
      }else if(this.btableitms[0].length == 33){
          for(let i =0 ; i<this.btableitms.length;i++){
           var obj29 = {};
           obj29[a] = this.btableitms[i][0];
           obj29[b] = this.btableitms[i][1];
           obj29[c] = this.btableitms[i][2];
           obj29[d] = this.btableitms[i][3];
           obj29[e] = this.btableitms[i][4];
           obj29[f] = this.btableitms[i][5];
           obj29[g] = this.btableitms[i][6];
           obj29[h] = this.btableitms[i][7];
           obj29[io] = this.btableitms[i][8];
           obj29[j] = this.btableitms[i][9];
           obj29[k] = this.btableitms[i][10];
           obj29[L] = this.btableitms[i][11];
           obj29[m] = this.btableitms[i][12];
           obj29[n] = this.btableitms[i][13];
           obj29[o] = this.btableitms[i][14];
           obj29[p] = this.btableitms[i][15];
           obj29[q] = this.btableitms[i][16];
           obj29[r] = this.btableitms[i][17];
           obj29[s] = this.btableitms[i][18];
           obj29[t] = this.btableitms[i][19];
           obj29[u] = this.btableitms[i][20];
           obj29[v] = this.btableitms[i][21];
           obj29[w] = this.btableitms[i][22];
           obj29[x] = this.btableitms[i][23];
           obj29[y] = this.btableitms[i][24];
           obj29[z] = this.btableitms[i][25];
           obj29[mo] = this.btableitms[i][26];
           obj29[qa] = this.btableitms[i][27];
           obj29[qb] = this.btableitms[i][28];
           obj29[qc] = this.btableitms[i][29];
           obj29[qd] = this.btableitms[i][30];
           obj29[qe] = this.btableitms[i][31];
           obj29[qf] = this.btableitms[i][32];
         }
         this.tablelistitems.push(obj29);
      }else if(this.btableitms[0].length == 34){
         for(let i =0 ; i<this.btableitms.length;i++){
            var obj30 = {};
              obj30[a] = this.btableitms[i][0];
              obj30[b] = this.btableitms[i][1];
              obj30[c] = this.btableitms[i][2];
              obj30[d] = this.btableitms[i][3];
              obj30[e] = this.btableitms[i][4];
              obj30[f] = this.btableitms[i][5];
              obj30[g] = this.btableitms[i][6];
              obj30[h] = this.btableitms[i][7];
              obj30[io] = this.btableitms[i][8];
              obj30[j] = this.btableitms[i][9];
              obj30[k] = this.btableitms[i][10];
              obj30[L] = this.btableitms[i][11];
              obj30[m] = this.btableitms[i][12];
              obj30[n] = this.btableitms[i][13];
              obj30[o] = this.btableitms[i][14];
              obj30[p] = this.btableitms[i][15];
              obj30[q] = this.btableitms[i][16];
              obj30[r] = this.btableitms[i][17];
              obj30[s] = this.btableitms[i][18];
              obj30[t] = this.btableitms[i][19];
              obj30[u] = this.btableitms[i][20];
              obj30[v] = this.btableitms[i][21];
              obj30[w] = this.btableitms[i][22];
              obj30[x] = this.btableitms[i][23];
              obj30[y] = this.btableitms[i][24];
              obj30[z] = this.btableitms[i][25];
              obj30[mo] = this.btableitms[i][26];
              obj30[qa] = this.btableitms[i][27];
              obj30[qb] = this.btableitms[i][28];
              obj30[qc] = this.btableitms[i][29];
              obj30[qd] = this.btableitms[i][30];
              obj30[qe] = this.btableitms[i][31];
              obj30[qf] = this.btableitms[i][32];
              obj30[qh] = this.btableitms[i][33];
           }
            this.tablelistitems.push(obj30);
         }else if(this.btableitms[0].length == 35){
               for(let i =0 ; i<this.btableitms.length;i++){
                  var obj31 = {};
                    obj31[a] = this.btableitms[i][0];
                    obj31[b] = this.btableitms[i][1];
                    obj31[c] = this.btableitms[i][2];
                    obj31[d] = this.btableitms[i][3];
                    obj31[e] = this.btableitms[i][4];
                    obj31[f] = this.btableitms[i][5];
                    obj31[g] = this.btableitms[i][6];
                    obj31[h] = this.btableitms[i][7];
                    obj31[io] = this.btableitms[i][8];
                    obj31[j] = this.btableitms[i][9];
                    obj31[k] = this.btableitms[i][10];
                    obj31[L] = this.btableitms[i][11];
                    obj31[m] = this.btableitms[i][12];
                    obj31[n] = this.btableitms[i][13];
                    obj31[o] = this.btableitms[i][14];
                    obj31[p] = this.btableitms[i][15];
                    obj31[q] = this.btableitms[i][16];
                    obj31[r] = this.btableitms[i][17];
                    obj31[s] = this.btableitms[i][18];
                    obj31[t] = this.btableitms[i][19];
                    obj31[u] = this.btableitms[i][20];
                    obj31[v] = this.btableitms[i][21];
                    obj31[w] = this.btableitms[i][22];
                    obj31[x] = this.btableitms[i][23];
                    obj31[y] = this.btableitms[i][24];
                    obj31[z] = this.btableitms[i][25];
                    obj31[mo] = this.btableitms[i][26];
                    obj31[qa] = this.btableitms[i][27];
                    obj31[qb] = this.btableitms[i][28];
                    obj31[qc] = this.btableitms[i][29];
                    obj31[qd] = this.btableitms[i][30];
                    obj31[qe] = this.btableitms[i][31];
                    obj31[qf] = this.btableitms[i][32];
                    obj31[qh] = this.btableitms[i][33];
                    obj31[qy] = this.btableitms[i][34];
                }
                  this.tablelistitems.push(obj31);
         }
        
      
      
    },

    ////表格方法
    handietableClick(item) {
      alert(item);
    },

    cancelget() {
      // console.log("-----------------------终止请求");
      this.Popup_show = false;
      this.cancel();
      clearInterval(this.Popup_timer);
    },

    // 不良率柱状图
    query_barst() {
      let query_barst = this.$echarts.init(
        document.getElementById("query_barst")
      );
      var querbar = this.barlist2;
      var querkey = [];
      var querval = [];
      var quertotal = [];
      for (let i = 0; i < querbar.length; i++) {
        querkey.push(querbar[i].name);
        querval.push(querbar[i].val);
        quertotal.push(querbar[i].total);
      }
      var options = {
        title: [
          {
            text: "人工检测站点不良率统计",
            textStyle: {
              fontWeight: 200,
            },
            left: "center",
            y: "3%",
          },
          {
            subtext: "纵轴单位(个数)",
            subtextStyle: {
              align: "left",
              lineHeight: 76,
              fontSize: 10,
              padding: 15,
            },
          },
        ],
        tooltip: {
          trigger: "axis",
          axisPointer: {
            // 坐标轴指示器，坐标轴触发有效
            type: "shadow", // 默认为直线，可选为：'line' | 'shadow'
          },
        
        },
        legend: {
          data: ["不良率", "员工"],
          right: "10%",
        },
        xAxis: {
          type: "category",
          data: querkey,
          axisLabel: {
            interval: 0,
            rotate: 60,
          },
        },
        yAxis: [
          {
            type: "value",
          },
          {
            type: "value",
            axisLabel: {
              formatter: "{value}%",
            },
          },
        ],
        dataZoom: [
          {
            type: "slider",
            show: true,
            start: 0,
            end: 100,
            handleSize: 8,
          },
          {
            type: "inside",
            start: 0,
            end: 100,
          },
          {
            type: "slider",
            show: true,
            yAxisIndex: 0,
            filterMode: "empty",
            width: 12,
            height: "70%",
            handleSize: 8,
            showDataShadow: false,
            left: "93%",
          },
        ],
        series: [
          {
            data: quertotal,
            name: "员工",
            type: "bar",
            barWidth: "10%",
            showBackground: true,
            backgroundStyle: {
              color: "rgba(220, 220, 220, 0.8)",
            },
            label: {
              // show: true,
              position: "insideRight",
              textStyle: {
                color: "black",
                fontSize: 14,
              },
              itemStyle: {
                normal: {
                  color: "rgb(47, 117, 221)",
                },
              },
            },
          },
          {
            name: "不良率",
            type: "line",
            yAxisIndex: 1,
            label: {
              normal: {
                show: true,
                position: "insideRight",
                formatter: function (params) {
                  //标签内容
                  return params.value + "%";
                },
              },
            },
            lineStyle: {
              normal: {
                type: "dashed",
                color: "#000",
              },
            },
            smooth: false,
            markPoint: {
              symbolOffset: ["70%", "90%"],
            },
            data: querval,
          },
        ],
      };
      window.onresize = function () {
        query_barst.resize();
      };
      query_barst.setOption(options, true);
    },
    // 人员重叠柱形图
    query_barey() {
      let query_barey = this.$echarts.init(
        document.getElementById("query_barey")
      );
      var list = [];
      var namekey = [];
      var defekey = [];
      var datalist = [];

      //  console.log('------------------------',this.listbar)

      for (let i = 0; i < this.listbar.length; i++) {
        namekey.push(this.listbar[i].key);
        datalist = this.listbar[i].val;
      }
      for (let i = 0; i < datalist.length; i++) {
        defekey.push(datalist[i].def);
      }

      this.listbar.forEach((ele) => {
        list.push({
          name: ele.key,
          data: ele.val.map((item) => {
            return item;
          }),
          type: "bar",
          stack: "a",
          barWidth: "15%",
          label: {
            show: false,
          },
        });
      });

      var option = {
        title: [
          {
            text: "人工缺陷统计",
            left: "center",
            y: "0%",
            textStyle: {
              fontWeight: 300,
            },
          },
          {
            subtext: "纵轴单位(个数)",
            subtextStyle: {
              align: "left",
              lineHeight: 96,
              fontSize: 10,
              padding: 15,
            },
          },
        ],
        tooltip: {
          trigger: "axis",
          axisPointer: {
            // 坐标轴指示器，坐标轴触发有效
            type: "shadow", // 默认为直线，可选为：'line' | 'shadow'
          },
          position: function (point, params, dom, rect, size) {
            // 鼠标坐标和提示框位置的参考坐标系是：以外层div的左上角那一点为原点，x轴向右，y轴向下
            // 提示框位置
            var x = 0; // x坐标位置
            var y = 0; // y坐标位置

            // 当前鼠标位置
            var pointX = point[0];
            var pointY = point[1];

            // 外层div大小
            // var viewWidth = size.viewSize[0];
            // var viewHeight = size.viewSize[1];

            // 提示框大小
            var boxWidth = size.contentSize[0];
            var boxHeight = size.contentSize[1];

            // boxWidth > pointX 说明鼠标左边放不下提示框
            if (boxWidth > pointX) {
              x = 5;
            } else {
              // 左边放的下
              x = pointX - boxWidth;
            }

            // boxHeight > pointY 说明鼠标上边放不下提示框
            if (boxHeight > pointY) {
              y = 5;
            } else {
              // 上边放得下
              y = pointY - boxHeight;
            }

            return [x, y];
          },
        },
        legend: {
          type: "scroll",
          // orient: "vertical",
          bottom: 20,
          x: "center",
          y: "30px",
          data: namekey,
          verticalAlign: "center",
          // left: "0%",
        },
        grid: {
          left: "5%",
          right: "7%",
          bottom: "2%",
          height: 260,
          containLabel: true,
        },
        xAxis: {
          type: "category",
          data: this.xAis,
          axisLabel: {
            interval: 0,
            rotate: 60,
          },
          // data:['09:00','10:00',"11:00","12:00",'13:00',"14:00","15:00","16:00","17:00","18:00","19:00","20:00"]
        },
        dataZoom: [
          {
            type: "slider",
            show: true,
            start: 0,
            end: 100,
            handleSize: 8,
          },
          {
            type: "inside",
            start: 0,
            end: 100,
          },
          {
            type: "slider",
            show: true,
            yAxisIndex: 0,
            filterMode: "empty",
            width: 12,
            height: "70%",
            handleSize: 8,
            showDataShadow: false,
            left: "93%",
          },
        ],
        yAxis: {
          type: "value",
        },
        series: list,
      };
      query_barey.setOption(option, true);
      window.onresize = function () {
        query_barey.resize();
      };
      var selected = {};
      var isShow;
      for (var i = 0; i < option.series.length; i++) {
        selected[option.series[i].name] = true;
        isShow = false;
        if (i == option.series.length - 1) {
          isShow = true;
        }
        option.series[i].label = {
          normal: {
            show: isShow,
            position: "top",
            textStyle: {
              fontSize: "8px",
            },
          },
        };
        // option.series[i].label.normal.show = isShow;
      }
      var fun = function (obj) {
        var total = 0;
        for (var key in selected) {
          if (selected[key]) {
            for (var i = 0; i < option.series.length; i++) {
              if (key == option.series[i].name) {
                total += option.series[i].data[obj.dataIndex];
              }
            }
          }
        }
        return total;
      };
      option.series[option.series.length - 1].label.normal.formatter = fun;
      query_barey.setOption(option);
      query_barey.on("legendselectchanged", function (obj) {
        selected = obj.selected;
        var flag = true;
        for (var i = option.series.length - 1; i >= 0; i--) {
          //只展示最后一个没有隐藏的列的label
          if (flag && selected[option.series[i].name]) {
            flag = false;
            option.series[i].label.normal.show = true;
            option.series[i].label.normal.formatter = fun;
          } else {
            option.series[i].label.normal.show = false;
            option.series[i].label.normal.formatter = function () {
              return "";
            };
          }
        }
        //重新设置option
        query_barey.setOption(option);
      });
    },

    loadAll() {
      // return [{ value: "", address: "" }];
    },
    querySearch(queryString, cb) {
      var restaurants = this.restaurants;
      var results = queryString
        ? restaurants.filter(this.createFilter(queryString))
        : restaurants;
      // 调用 callback 返回建议列表的数据
      cb(results);
    },
    createFilter(queryString) {
      return (restaurant) => {
        return (
          restaurant.value.toLowerCase().indexOf(queryString.toLowerCase()) ===
          0
        );
      };
    },




    handleSelect(item) {
      console.log(item);
    },
    handleIconClick(ev) {
      console.log(ev);
    },
  },
  mounted() {
    this.getModelnolist();
    // this.restaurants = this.loadAll();
  },
};
</script>

<style  scoped>
.query_content {
  width: 100%;
}
.query_serch {
  width: 100%;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
  background: #ffffff;
}
.query_hader {
  width: 100%;
  background: #ffffff;
  margin-top: 10px;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
}

.query_table {
  width: 100%;
  border-radius: 5px 5px 5px 5px;
}
#quety_bra {
  width: 100%;
  height: 360px;
  background: #ffffff;
  margin-top: 10px;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
}
#query_barst {
  width: 100%;
  height: 300px;
  margin-top: 10px;
  background: #ffffff;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
}
.query_table {
  width: 100%;
  margin-top: 5px;
}
#query_barey {
  width: 100%;
  height: 350px;
  margin-top: 10px;
  background: #ffffff;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
}
.query_table_to {
  width: 100%;
  margin-top: 15px;
  background: #ffffff;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
}

.table_serch {
  width: 100%;
  min-width: 1000px;
  padding-top: 8px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
}
.table_serch_labe {
  height: 35px;
  display: flex;
  margin-left: 10px;
  margin-bottom: 10px;
}
.table_serch_labe_title {
  font-size: 11px;
  line-height: 40px;
}
.el-button_eb {
  margin-left: 5px;
  color: #fff;
}

.table_loding {
  width: 200px;
  height: 100px;
  border: 1px solid rgb(68, 186, 236);
  position: absolute;
  z-index: 999;
  top: 40%;
  left: 40%;
  border-radius: 5px 5px 5px 5px;
  box-shadow: 0px 0px 0px 1px;
}

.table_title {
  color: rgb(101, 91, 91);
  font-size: 20px;
  text-align: center;
  line-height: 60px;
}
.table_timer {
  color: rgb(101, 91, 91);
  font-size: 20px;
  text-align: center;
  line-height: 10px;
}
#revpen {
  margin-left: 0px;
}

.query_table {
  table-layout: fixed;
  border-collapse: collapse;
  /* width: 100%; */
}

#query_leak {
  width: 100%;
  height: 50vh;
  background: #ffffff;
  box-shadow: 0px 0px 0px 1.5px #c9c8c8;
  border-radius: 5px 5px 5px 5px;
  margin-top: 20px;
}

.upload-demo_box {
  margin-right: 22%;
}
.table_query {
  text-align: center;
}
/* 搜索框沾满全屏 */

@media screen and (min-width: 1920px) {
  #revpen {
    margin-left: 10px;
  }
  .and_table {
    margin-left: 0.5%;
  }
  .upload-demo_box {
    margin-right: 38.3%;
    /* display:none; */
  }
  .order {
    margin-left: 5px;
  }
}
</style> 





